#include <bits/stdc++.h>
using namespace std;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using ll = long long;
void solve()
{
    ll n;
    vector<ll> a(n);
    cin >> n;
    for (ll i = 0; i < n;i++)
    {
        cin >> a[i];
    }
    if(n<=10)
    {
        ll ans = 0;
        for (ll i = 0; i < n;i++)
        {
            ans +=  a[i];
        }
        cout << ans << endl;
    }
    else {
        ll sum = 0,ans=0;
        ll max_x = -1, pos = 0;
        for (ll i = 0; i < n;i++)
        {
            if(i<10)
            {
                sum += a[i];
            }
            else {
                sum += a[i];
                sum -= a[i - 10];
                ans = max(ans, sum);
            }

        }
        cout << ans;
    }
}
int main()
{
    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
   return 0;
}
